/** 
 * Project Name:tinysql 
 * File Name:ResultColumnArrayList.java 
 * Package Name:com.wdy.golden.tinysql.extend 
 * Date:2021年2月22日下午3:47:15 
 * 
*/  
package com.wdy.golden.tinysql.extend;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/** 
 * ClassName: ResultColumnArrayList <br/> 
 * Function: TODO ADD FUNCTION. <br/> 
 * Reason:   TODO ADD REASON. <br/> 
 * Date:     2021年2月22日 下午3:47:15 <br/> 
 * @author   DongYe_Wu 
 * @version
 * @see       
 */
public class ResultColumnArrayList<E> extends ArrayList<E> {
	private static final long serialVersionUID = 1L;
	
	public static final class Clazz {
		public static final String result = "result";
	}

	public static final class Fields  {
		public static final String columns = "columns";
		public static final String properties = "properties";
		public static final String total = "total";
	}
	
	public static final class Methods {
		public static final String setColumns = "setColumns";
		public static final String setProperties = "setProperties";
		public static final String setTotal = "setTotal";
	}

	private List<String> columns;
	private List<String> properties;
	private int total;

	public List<String> getColumns() {
		return columns;
	}

	public void setColumns(List<String> columns) {
		this.columns = columns;
	}

	public List<String> getProperties() {
		return properties;
	}

	public void setProperties(List<String> properties) {
		this.properties = properties;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public String toString() {
		JSONObject jsonObj = new JSONObject();
		jsonObj.put(Clazz.result, this);
		jsonObj.put(Fields.columns, this.getColumns());
		jsonObj.put(Fields.properties, this.getProperties());
		jsonObj.put(Fields.total, this.getTotal());
		return JSON.toJSONString(jsonObj);
	}
}
